﻿
namespace SQLStore
{
    using Models;
    using System.Data.Entity.ModelConfiguration;
    public class ContentsMap : EntityTypeConfiguration<Contents>
    {
        public ContentsMap()
        {
            ToTable("Contents");
            HasKey(t => t.Id);

            Property(t => t.Name)
                 .HasColumnName("Name")
                 .HasMaxLength(512);

            Property(t => t.State)
                  .HasColumnName("State")
                  .HasMaxLength(512);
            Property(t => t.Seed)
                .HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity);

            Property(t => t.SourceUrl)
                .HasColumnName("SourceUrl")
                .HasMaxLength(512);

            Property(t => t.Intro)
               .HasColumnName("Intro")
               .HasMaxLength(2000);
        }
    }
}
